import { State } from 'jumpstate';
interface UserInfo {
	accessToken: string;
	userId: number;
	name: string;
}

export type UserStoreState = UserInfo;

/**
 * 用户信息相关
 */
const userStore = State('user', {
	initial: {
    name: 'alvin'
  },
	setUserInfo(state: UserStoreState, payload: UserStoreState) {
		return {
			...state,
			...payload
		};
	}
});

export default userStore;
